Split string command and entrypoint after interpolation - #1520
Split string command and entrypoint after interpolation#1520Sanjays2402 wants to merge 4 commits into
Conversation
PR containers#1504 removed the shlex.split() of string `command`/`entrypoint` from normalize_service because it ran before variable interpolation and broke expressions such as ${VAR:?error message}. Nothing re-applied the split afterwards, so `podman-compose config` regressed to emitting `command: sleep infinity` as a plain string instead of the array docker-compose produces. normalize_service_final runs after rec_subs, so the split is applied there. container_to_args already handled both forms, so only the config output was affected. Signed-off-by: Sanjay Santhanam <51058514+Sanjays2402@users.noreply.github.com>
| ({"image": "busybox", "entrypoint": "/bin/sh -c"}, None, ["/bin/sh", "-c"]), | ||
| ] | ||
|
|
||
| @parameterized.expand(cases_command_normalization) |
There was a problem hiding this comment.
Just include the list inline as expand() parameter
There was a problem hiding this comment.
Done in 1ea4d1d — the list is inline in expand() now. 44 tests in that file pass, ruff format/check clean.
p12tic
left a comment
There was a problem hiding this comment.
Looks great, thanks. Just one nit.
|
@Sanjays2402 All tests are failing for some reason |
Signed-off-by: Sanjay Santhanam <51058514+Sanjays2402@users.noreply.github.com>
|
The failures were four stale config-output expectations, not failures in the command splitting itself. I updated all four |
Closes #1514
Contributor Checklist:
Please make sure to read development guidelines in CONTRIBUTING.md. Pull requests that do not
follow the guidelines WILL TAKE LONGER TO REVIEW as the first review comment will be to follow
these guidelines.
If this PR adds a new feature that improves compatibility with docker-compose, please add a link
to the exact part of compose spec that the PR touches.
For any user-visible change please add a release note to newsfragments directory, e.g.
newsfragments/my_feature.feature. See newsfragments/README.txt for more details.
All changes require additional unit tests.
Bug fix, not a new feature, so no compose spec link applies.
#1504 removed the
shlex.split()of stringcommand/entrypointfromnormalize_service(it ran before interpolation and broke${VAR:?error message}), but nothing re-applied the split afterwards, sopodman-compose configregressed to emittingcommand: sleep infinityinstead of the array docker-compose produces.normalize_service_finalruns afterrec_subs, so the split now happens there.Unit tests added in
tests/unit/test_normalize_final_build.py(fail without the fix, pass with it). I did not add a newsfragment - happy to add one if you would like it for this regression fix.